package com.hson.demo.soa.remote.exception;

import org.springframework.core.ErrorCoded;

public class DemoSoaException extends Exception implements ErrorCoded {
	
	private static final long serialVersionUID = 9139006531963397795L;
	
	private String errorCode;
	
	
	public DemoSoaException(String errorCode) {
		super();
		setErrorCode(errorCode);
	}

	public DemoSoaException(String errorCode, String message) {
		super(message);
		setErrorCode(errorCode);
	}

	public DemoSoaException(String errorCode, String message, Throwable cause) {
		super(message, cause);
		setErrorCode(errorCode);
	}

	public DemoSoaException(String errorCode, Throwable cause) {
		super(cause);
		setErrorCode(errorCode);
	}

	
	@Override
	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	@Override
	public String getMessage() {
		return getErrorCode() + " : " + super.getMessage();
	}

	
}
